import React, { Component } from 'react'
import styles from "./index.module.css"
import { PickerView } from 'antd-mobile';
import BtnFoot from "../../../../components/BtnFoot"


export default class FilterPicker extends Component {

    state = {
        value: this.props.defaultValue,
    };
    componentDidMount() {
        // console.log('子组件defaultValue的值',this.props.defaultValue)
    }
    render() {

        const { onCancel, onEnter, data, cols, type } = this.props
        const { value } = this.state
        // console.log('子组件defaultValue的值',this.state.value)
        return (
            <div className={styles.filterpicker}>
                <PickerView
                    data={data}
                    value={value}
                    cols={cols}
                    onChange={val => {
                        this.setState({
                            value: val
                        })
                    }}
                />
                <div className={styles.btn_box}>
                    <BtnFoot onCancel={() => onCancel(type)} onEnter={() => onEnter(type, value)} />
                </div>

            </div>
        )
    }
}